#include<bits/stdc++.h>
using namespace std;
int h[11];
int main()
{
    int m,n,maxh=0;
    scanf("%d%d",&n,&m);
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&h[i]);
        if (maxh<=h[i]) maxh=h[i];
    }
    for (int i=maxh;i>=1;i--)
    {
        int tm=0;
        for (int j=1;j<=n;j++)
        {
            int c=h[j]-i;
            if (c<0) c=0;
            tm+=c;
        }
        if (tm>=m)
        {
            printf("%d",i);
            break;
        }
    }
    system("pause");
    return 0;
}
